package com.freedomlane.pgen;


/**
 * The level of password as an enumerated constant can be given by using this
 * enum.  All possible combinations of strength for a password are already
 * defined.
 *
 * @author Sandeep Ellawala
 *
 * @version 1.0
 *
 * @since 1.0
 */
public enum PasswordLevel {
    NONE(0),
    LOWER(1),
    UPPER(2),
    DIGIT(3),
    SPECIAL(4),
    LOWER_UPPER(5),
    LOWER_DIGIT(6),
    LOWER_SPECIAL(7),
    UPPER_DIGIT(8),
    UPPER_SPECIAL(9),
    DIGIT_SPECIAL(10),
    LOWER_UPPER_DIGIT(11),
    LOWER_UPPER_SPECIAL(12),
    LOWER_DIGIT_SPECIAL(13),
    UPPER_DIGIT_SPECIAL(14),
    LOWER_UPPER_DIGIT_SPECIAL(15);
    
    private int level;


    /**
     * Creates a PasswordLevel enumerated constant with the given level as an
     * attribute.
     *
     * @param level A numeric representation of the level that is attributed to
     * an enumerated level constant.
     */
    private PasswordLevel(int level) {
        //As this is a private constructor, I don't think that there is any need
        //to validate the arguments passed to this parameter.  If you insist, be
        //my guest and waste your time with it.
        
        this.level = level;
    }


    /**
     * Get a numeric representation of this enumerated level constant.
     *
     * @return A numeric value representing this level constant.
     */
    public int getLevel() {
        return this.level;
    }
}